home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / Fonts.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  20.7 KB  |  674 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        Fonts.h
  3.  
  4.      Contains:    Public interface to the Font Manager.
  5.  
  6.      Version:    Technology:    Mac OS 9
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1985-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __FONTS__
  18. #define __FONTS__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __FILES__
  25.     #include <Files.h>
  26. #endif
  27.  
  28. #ifndef __QUICKDRAW__
  29.     #include <Quickdraw.h>
  30. #endif
  31.  
  32. #ifndef __TEXTCOMMON__
  33.     #include <TextCommon.h>
  34. #endif
  35.  
  36. #ifndef __MACERRORS__
  37.     #include <MacErrors.h>
  38. #endif
  39.  
  40.  
  41.  
  42.  
  43. #if PRAGMA_ONCE
  44. #pragma once
  45. #endif
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51. #if PRAGMA_IMPORT
  52. #pragma import on
  53. #endif
  54.  
  55. #if PRAGMA_STRUCT_ALIGN
  56.     #pragma options align=mac68k
  57. #elif PRAGMA_STRUCT_PACKPUSH
  58.     #pragma pack(push, 2)
  59. #elif PRAGMA_STRUCT_PACK
  60.     #pragma pack(2)
  61. #endif
  62.  
  63. enum {
  64.     systemFont                    = 0,
  65.     applFont                    = 1
  66. };
  67.  
  68. /* kPlatformDefaultGuiFontID is used in QuickTime 3.0. */
  69. #if TARGET_OS_MAC
  70. enum {
  71.     kPlatformDefaultGuiFontID    = applFont
  72. };
  73.  
  74. #else
  75. enum {
  76.     kPlatformDefaultGuiFontID    = -1
  77. };
  78.  
  79. #endif  /* TARGET_OS_MAC */
  80.  
  81. /*    The following font constants are deprecated; use GetFNum() to look up the font ID by name. */
  82. enum {
  83.     kFontIDNewYork                = 2,
  84.     kFontIDGeneva                = 3,
  85.     kFontIDMonaco                = 4,
  86.     kFontIDVenice                = 5,
  87.     kFontIDLondon                = 6,
  88.     kFontIDAthens                = 7,
  89.     kFontIDSanFrancisco            = 8,
  90.     kFontIDToronto                = 9,
  91.     kFontIDCairo                = 11,
  92.     kFontIDLosAngeles            = 12,
  93.     kFontIDTimes                = 20,
  94.     kFontIDHelvetica            = 21,
  95.     kFontIDCourier                = 22,
  96.     kFontIDSymbol                = 23,
  97.     kFontIDMobile                = 24
  98. };
  99.  
  100. enum {
  101.     commandMark                    = 17,
  102.     checkMark                    = 18,
  103.     diamondMark                    = 19,
  104.     appleMark                    = 20
  105. };
  106.  
  107. enum {
  108.     propFont                    = 36864L,
  109.     prpFntH                        = 36865L,
  110.     prpFntW                        = 36866L,
  111.     prpFntHW                    = 36867L,
  112.     fixedFont                    = 45056L,
  113.     fxdFntH                        = 45057L,
  114.     fxdFntW                        = 45058L,
  115.     fxdFntHW                    = 45059L,
  116.     fontWid                        = 44208L
  117. };
  118.  
  119.  
  120. struct FMInput {
  121.     short                             family;
  122.     short                             size;
  123.     Style                             face;
  124.     Boolean                         needBits;
  125.     short                             device;
  126.     Point                             numer;
  127.     Point                             denom;
  128. };
  129. typedef struct FMInput                    FMInput;
  130.  
  131. struct FMOutput {
  132.     short                             errNum;
  133.     Handle                             fontHandle;
  134.     UInt8                             boldPixels;
  135.     UInt8                             italicPixels;
  136.     UInt8                             ulOffset;
  137.     UInt8                             ulShadow;
  138.     UInt8                             ulThick;
  139.     UInt8                             shadowPixels;
  140.     SInt8                             extra;
  141.     UInt8                             ascent;
  142.     UInt8                             descent;
  143.     UInt8                             widMax;
  144.     SInt8                             leading;
  145.     SInt8                             curStyle;
  146.     Point                             numer;
  147.     Point                             denom;
  148. };
  149. typedef struct FMOutput                    FMOutput;
  150. typedef FMOutput *                        FMOutputPtr;
  151.  
  152. typedef FMOutputPtr                     FMOutPtr;
  153.  
  154. struct FontRec {
  155.     short                             fontType;                    /*font type*/
  156.     short                             firstChar;                    /*ASCII code of first character*/
  157.     short                             lastChar;                    /*ASCII code of last character*/
  158.     short                             widMax;                        /*maximum character width*/
  159.     short                             kernMax;                    /*negative of maximum character kern*/
  160.     short                             nDescent;                    /*negative of descent*/
  161.     short                             fRectWidth;                    /*width of font rectangle*/
  162.     short                             fRectHeight;                /*height of font rectangle*/
  163.     unsigned short                     owTLoc;                        /*offset to offset/width table*/
  164.     short                             ascent;                        /*ascent*/
  165.     short                             descent;                    /*descent*/
  166.     short                             leading;                    /*leading*/
  167.     short                             rowWords;                    /*row width of bit image / 2 */
  168. };
  169. typedef struct FontRec                    FontRec;
  170. typedef FontRec *                        FontRecPtr;
  171. typedef FontRecPtr *                    FontRecHdl;
  172.  
  173. struct FMetricRec {
  174.     Fixed                             ascent;                        /*base line to top*/
  175.     Fixed                             descent;                    /*base line to bottom*/
  176.     Fixed                             leading;                    /*leading between lines*/
  177.     Fixed                             widMax;                        /*maximum character width*/
  178.     Handle                             wTabHandle;                    /*handle to font width table*/
  179. };
  180. typedef struct FMetricRec                FMetricRec;
  181. typedef FMetricRec *                    FMetricRecPtr;
  182. typedef FMetricRecPtr *                    FMetricRecHandle;
  183.  
  184. struct WidEntry {
  185.     short                             widStyle;                    /*style entry applies to*/
  186. };
  187. typedef struct WidEntry                    WidEntry;
  188.  
  189. struct WidTable {
  190.     short                             numWidths;                    /*number of entries - 1*/
  191. };
  192. typedef struct WidTable                    WidTable;
  193.  
  194. struct AsscEntry {
  195.     short                             fontSize;
  196.     short                             fontStyle;
  197.     short                             fontID;                        /*font resource ID*/
  198. };
  199. typedef struct AsscEntry                AsscEntry;
  200.  
  201. struct FontAssoc {
  202.     short                             numAssoc;                    /*number of entries - 1*/
  203. };
  204. typedef struct FontAssoc                FontAssoc;
  205.  
  206. struct StyleTable {
  207.     short                             fontClass;
  208.     long                             offset;
  209.     long                             reserved;
  210.     char                             indexes[48];
  211. };
  212. typedef struct StyleTable                StyleTable;
  213.  
  214. struct NameTable {
  215.     short                             stringCount;
  216.     Str255                             baseFontName;
  217. };
  218. typedef struct NameTable                NameTable;
  219.  
  220. struct KernPair {
  221.     char                             kernFirst;                    /*1st character of kerned pair*/
  222.     char                             kernSecond;                    /*2nd character of kerned pair*/
  223.     short                             kernWidth;                    /*kerning in 1pt fixed format*/
  224. };
  225. typedef struct KernPair                    KernPair;
  226.  
  227. struct KernEntry {
  228.     short                             kernStyle;                    /*style the entry applies to*/
  229.     short                             kernLength;                    /*length of this entry*/
  230. };
  231. typedef struct KernEntry                KernEntry;
  232.  
  233. struct KernTable {
  234.     short                             numKerns;                    /*number of kerning entries*/
  235. };
  236. typedef struct KernTable                KernTable;
  237.  
  238. struct WidthTable {
  239.     Fixed                             tabData[256];                /*character widths*/
  240.     Handle                             tabFont;                    /*font record used to build table*/
  241.     long                             sExtra;                        /*space extra used for table*/
  242.     long                             style;                        /*extra due to style*/
  243.     short                             fID;                        /*font family ID*/
  244.     short                             fSize;                        /*font size request*/
  245.     short                             face;                        /*style (face) request*/
  246.     short                             device;                        /*device requested*/
  247.     Point                             inNumer;                    /*scale factors requested*/
  248.     Point                             inDenom;                    /*scale factors requested*/
  249.     short                             aFID;                        /*actual font family ID for table*/
  250.     Handle                             fHand;                        /*family record used to build up table*/
  251.     Boolean                         usedFam;                    /*used fixed point family widths*/
  252.     UInt8                             aFace;                        /*actual face produced*/
  253.     short                             vOutput;                    /*vertical scale output value*/
  254.     short                             hOutput;                    /*horizontal scale output value*/
  255.     short                             vFactor;                    /*vertical scale output value*/
  256.     short                             hFactor;                    /*horizontal scale output value*/
  257.     short                             aSize;                        /*actual size of actual font used*/
  258.     short                             tabSize;                    /*total size of table*/
  259. };
  260. typedef struct WidthTable                WidthTable;
  261. typedef WidthTable *                    WidthTablePtr;
  262. typedef WidthTablePtr *                    WidthTableHdl;
  263.  
  264. struct FamRec {
  265.     short                             ffFlags;                    /*flags for family*/
  266.     short                             ffFamID;                    /*family ID number*/
  267.     short                             ffFirstChar;                /*ASCII code of 1st character*/
  268.     short                             ffLastChar;                    /*ASCII code of last character*/
  269.     short                             ffAscent;                    /*maximum ascent for 1pt font*/
  270.     short                             ffDescent;                    /*maximum descent for 1pt font*/
  271.     short                             ffLeading;                    /*maximum leading for 1pt font*/
  272.     short                             ffWidMax;                    /*maximum widMax for 1pt font*/
  273.     long                             ffWTabOff;                    /*offset to width table*/
  274.     long                             ffKernOff;                    /*offset to kerning table*/
  275.     long                             ffStylOff;                    /*offset to style mapping table*/
  276.     short                             ffProperty[9];                /*style property info*/
  277.     short                             ffIntl[2];                    /*for international use*/
  278.     short                             ffVersion;                    /*version number*/
  279. };
  280. typedef struct FamRec                    FamRec;
  281.  
  282. typedef SInt16                             FontPointSize;
  283. EXTERN_API( void )
  284. InitFonts                        (void)                                                        ONEWORDINLINE(0xA8FE);
  285.  
  286. EXTERN_API( void )
  287. GetFontName                        (short                     familyID,
  288.                                  Str255                 name)                                ONEWORDINLINE(0xA8FF);
  289.  
  290. EXTERN_API( void )
  291. GetFNum                            (ConstStr255Param         name,
  292.                                  short *                familyID)                            ONEWORDINLINE(0xA900);
  293.  
  294. EXTERN_API( Boolean )
  295. RealFont                        (short                     fontNum,
  296.                                  short                     size)                                ONEWORDINLINE(0xA902);
  297.  
  298. EXTERN_API( void )
  299. SetFontLock                        (Boolean                 lockFlag)                            ONEWORDINLINE(0xA903);
  300.  
  301. EXTERN_API( FMOutPtr )
  302. FMSwapFont                        (const FMInput *        inRec)                                ONEWORDINLINE(0xA901);
  303.  
  304. EXTERN_API( void )
  305. SetFScaleDisable                (Boolean                 fscaleDisable)                        ONEWORDINLINE(0xA834);
  306.  
  307. EXTERN_API( void )
  308. FontMetrics                        (FMetricRecPtr             theMetrics)                            ONEWORDINLINE(0xA835);
  309.  
  310. EXTERN_API( void )
  311. SetFractEnable                    (Boolean                 fractEnable)                        ONEWORDINLINE(0xA814);
  312.  
  313. EXTERN_API( short )
  314. GetDefFontSize                    (void)                                                        FIVEWORDINLINE(0x3EB8, 0x0BA8, 0x6604, 0x3EBC, 0x000C);
  315.  
  316. EXTERN_API( Boolean )
  317. IsOutline                        (Point                     numer,
  318.                                  Point                     denom)                                TWOWORDINLINE(0x7000, 0xA854);
  319.  
  320. EXTERN_API( void )
  321. SetOutlinePreferred                (Boolean                 outlinePreferred)                    TWOWORDINLINE(0x7001, 0xA854);
  322.  
  323. EXTERN_API( Boolean )
  324. GetOutlinePreferred                (void)                                                        TWOWORDINLINE(0x7009, 0xA854);
  325.  
  326. EXTERN_API( OSErr )
  327. OutlineMetrics                    (short                     byteCount,
  328.                                  const void *            textPtr,
  329.                                  Point                     numer,
  330.                                  Point                     denom,
  331.                                  short *                yMax,
  332.                                  short *                yMin,
  333.                                  FixedPtr                 awArray,
  334.                                  FixedPtr                 lsbArray,
  335.                                  RectPtr                 boundsArray)                        TWOWORDINLINE(0x7008, 0xA854);
  336.  
  337. EXTERN_API( void )
  338. SetPreserveGlyph                (Boolean                 preserveGlyph)                        TWOWORDINLINE(0x700A, 0xA854);
  339.  
  340. EXTERN_API( Boolean )
  341. GetPreserveGlyph                (void)                                                        TWOWORDINLINE(0x700B, 0xA854);
  342.  
  343. EXTERN_API( OSErr )
  344. FlushFonts                        (void)                                                        TWOWORDINLINE(0x700C, 0xA854);
  345.  
  346. EXTERN_API_C( void )
  347. getfnum                            (const char *            theName,
  348.                                  short *                familyID);
  349.  
  350. EXTERN_API_C( void )
  351. getfontname                        (short                     familyID,
  352.                                  char *                    theName);
  353.  
  354. EXTERN_API( short )
  355. GetSysFont                        (void)                                                        TWOWORDINLINE(0x3EB8, 0x0BA6);
  356.  
  357. EXTERN_API( short )
  358. GetAppFont                        (void)                                                        TWOWORDINLINE(0x3EB8, 0x0984);
  359.  
  360. /*--------------------------------------------------------------------------------------*/
  361. /*    Extended font data functions (available only with Mac OS 8.5 or later)                */
  362. /*--------------------------------------------------------------------------------------*/
  363. EXTERN_API( OSStatus )
  364. SetAntiAliasedTextEnabled        (Boolean                 iEnable,
  365.                                  SInt16                 iMinFontSize)                        TWOWORDINLINE(0x7011, 0xA854);
  366.  
  367. EXTERN_API( Boolean )
  368. IsAntiAliasedTextEnabled        (SInt16 *                oMinFontSize)                        TWOWORDINLINE(0x7012, 0xA854);
  369.  
  370. EXTERN_API( void )
  371. QDTextBounds                    (short                     byteCount,
  372.                                  const void *            textAddr,
  373.                                  Rect *                    bounds)                                TWOWORDINLINE(0x7013, 0xA854);
  374.  
  375. EXTERN_API( OSErr )
  376. FetchFontInfo                    (SInt16                 fontID,
  377.                                  SInt16                 fontSize,
  378.                                  SInt16                 fontStyle,
  379.                                  FontInfo *                info)                                TWOWORDINLINE(0x7014, 0xA854);
  380.  
  381. /*--------------------------------------------------------------------------------------*/
  382. /*    Font access and data management functions (available only with Mac OS 9.0 or later)    */
  383. /*--------------------------------------------------------------------------------------*/
  384. typedef UInt32                             FMGeneration;
  385. /* The FMFontFamily reference represents a collection of fonts with the same design     */
  386. /* characteristics. It replaces the standard QuickDraw font identifer and may be used   */
  387. /* with all QuickDraw functions including GetFontName and TextFont. It cannot be used   */
  388. /* with the Resource Manager to access information from a FOND resource handle. A font  */
  389. /* reference does not imply a particular script system, nor is the character encoding   */
  390. /* of a font family determined by an arithmetic mapping of its value.                   */
  391. typedef SInt16                             FMFontFamily;
  392. typedef SInt16                             FMFontStyle;
  393. typedef SInt16                             FMFontSize;
  394. /* The font family is a collection of fonts, each of which is identified by an FMFont   */
  395. /* reference that maps to a single object registered with the font database. The font    */
  396. /* references associated with the font family consist of individual outline and         */
  397. /* bitmapped fonts that may be used with the font access routines of the Font Manager   */
  398. /* and ATS Unicode. */
  399. typedef UInt32                             FMFont;
  400.  
  401. struct FMFontFamilyInstance {
  402.     FMFontFamily                     fontFamily;
  403.     FMFontStyle                     fontStyle;
  404. };
  405. typedef struct FMFontFamilyInstance        FMFontFamilyInstance;
  406.  
  407. struct FMFontFamilyIterator {
  408.     UInt32                             reserved[16];
  409. };
  410. typedef struct FMFontFamilyIterator        FMFontFamilyIterator;
  411.  
  412. struct FMFontIterator {
  413.     UInt32                             reserved[16];
  414. };
  415. typedef struct FMFontIterator            FMFontIterator;
  416.  
  417. struct FMFontFamilyInstanceIterator {
  418.     UInt32                             reserved[16];
  419. };
  420. typedef struct FMFontFamilyInstanceIterator FMFontFamilyInstanceIterator;
  421. enum {
  422.     kInvalidGeneration            = 0L,
  423.     kInvalidFontFamily            = -1,
  424.     kInvalidFont                = 0L,
  425.     kFMCurrentFilterFormat        = 0L,
  426.     kFMDefaultOptions            = kNilOptions,
  427.     kFMUseGlobalScopeOption        = 0x00000001
  428. };
  429.  
  430.  
  431. typedef UInt32 FMFilterSelector;
  432. enum {
  433.     kFMInvalidFilterSelector    = 0L,
  434.     kFMFontTechnologyFilterSelector = 1L,
  435.     kFMFontContainerFilterSelector = 2L,
  436.     kFMGenerationFilterSelector    = 3L,
  437.     kFMFontFamilyCallbackFilterSelector = 4L,
  438.     kFMFontCallbackFilterSelector = 5L
  439. };
  440.  
  441. enum {
  442.     kFMTrueTypeFontTechnology    = FOUR_CHAR_CODE('true'),
  443.     kFMPostScriptFontTechnology    = FOUR_CHAR_CODE('typ1')
  444. };
  445.  
  446. typedef CALLBACK_API( OSStatus , FMFontFamilyCallbackFilterProcPtr )(FMFontFamily iFontFamily, void *iRefCon);
  447. typedef CALLBACK_API( OSStatus , FMFontCallbackFilterProcPtr )(FMFont iFont, void *iRefCon);
  448. typedef STACK_UPP_TYPE(FMFontFamilyCallbackFilterProcPtr)         FMFontFamilyCallbackFilterUPP;
  449. typedef STACK_UPP_TYPE(FMFontCallbackFilterProcPtr)             FMFontCallbackFilterUPP;
  450. #if OPAQUE_UPP_TYPES
  451.     EXTERN_API(FMFontFamilyCallbackFilterUPP)
  452.     NewFMFontFamilyCallbackFilterUPP    (FMFontFamilyCallbackFilterProcPtr userRoutine);
  453.  
  454.     EXTERN_API(FMFontCallbackFilterUPP)
  455.     NewFMFontCallbackFilterUPP       (FMFontCallbackFilterProcPtr userRoutine);
  456.  
  457.     EXTERN_API(void)
  458.     DisposeFMFontFamilyCallbackFilterUPP    (FMFontFamilyCallbackFilterUPP userUPP);
  459.  
  460.     EXTERN_API(void)
  461.     DisposeFMFontCallbackFilterUPP    (FMFontCallbackFilterUPP userUPP);
  462.  
  463.     EXTERN_API(OSStatus)
  464.     InvokeFMFontFamilyCallbackFilterUPP    (FMFontFamily    iFontFamily,
  465.                                     void *                    iRefCon,
  466.                                     FMFontFamilyCallbackFilterUPP userUPP);
  467.  
  468.     EXTERN_API(OSStatus)
  469.     InvokeFMFontCallbackFilterUPP    (FMFont                iFont,
  470.                                     void *                    iRefCon,
  471.                                     FMFontCallbackFilterUPP    userUPP);
  472.  
  473. #else
  474.     enum { uppFMFontFamilyCallbackFilterProcInfo = 0x000003B0 };     /* pascal 4_bytes Func(2_bytes, 4_bytes) */
  475.     enum { uppFMFontCallbackFilterProcInfo = 0x000003F0 };             /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  476.     #define NewFMFontFamilyCallbackFilterUPP(userRoutine)             (FMFontFamilyCallbackFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFMFontFamilyCallbackFilterProcInfo, GetCurrentArchitecture())
  477.     #define NewFMFontCallbackFilterUPP(userRoutine)                 (FMFontCallbackFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFMFontCallbackFilterProcInfo, GetCurrentArchitecture())
  478.     #define DisposeFMFontFamilyCallbackFilterUPP(userUPP)             DisposeRoutineDescriptor(userUPP)
  479.     #define DisposeFMFontCallbackFilterUPP(userUPP)                 DisposeRoutineDescriptor(userUPP)
  480.     #define InvokeFMFontFamilyCallbackFilterUPP(iFontFamily, iRefCon, userUPP)  (OSStatus)CALL_TWO_PARAMETER_UPP((userUPP), uppFMFontFamilyCallbackFilterProcInfo, (iFontFamily), (iRefCon))
  481.     #define InvokeFMFontCallbackFilterUPP(iFont, iRefCon, userUPP)     (OSStatus)CALL_TWO_PARAMETER_UPP((userUPP), uppFMFontCallbackFilterProcInfo, (iFont), (iRefCon))
  482. #endif
  483. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  484. #define NewFMFontFamilyCallbackFilterProc(userRoutine)             NewFMFontFamilyCallbackFilterUPP(userRoutine)
  485. #define NewFMFontCallbackFilterProc(userRoutine)                 NewFMFontCallbackFilterUPP(userRoutine)
  486. #define CallFMFontFamilyCallbackFilterProc(userRoutine, iFontFamily, iRefCon) InvokeFMFontFamilyCallbackFilterUPP(iFontFamily, iRefCon, userRoutine)
  487. #define CallFMFontCallbackFilterProc(userRoutine, iFont, iRefCon) InvokeFMFontCallbackFilterUPP(iFont, iRefCon, userRoutine)
  488.  
  489. struct FMFilter {
  490.     UInt32                             format;
  491.     FMFilterSelector                 selector;
  492.     union {
  493.         FourCharCode                     fontTechnologyFilter;
  494.         FSSpec                             fontContainerFilter;
  495.         FMGeneration                     generationFilter;
  496.         FMFontFamilyCallbackFilterUPP     fontFamilyCallbackFilter;
  497.         FMFontCallbackFilterUPP         fontCallbackFilter;
  498.     }                                 filter;
  499. };
  500. typedef struct FMFilter                    FMFilter;
  501. /* Enumeration */
  502. EXTERN_API_C( OSStatus )
  503. FMCreateFontFamilyIterator        (const FMFilter *        iFilter, /* can be NULL */
  504.                                  void *                    iRefCon,
  505.                                  OptionBits             iOptions,
  506.                                  FMFontFamilyIterator *    ioIterator);
  507.  
  508. EXTERN_API_C( OSStatus )
  509. FMDisposeFontFamilyIterator        (FMFontFamilyIterator *    ioIterator);
  510.  
  511. EXTERN_API_C( OSStatus )
  512. FMResetFontFamilyIterator        (const FMFilter *        iFilter, /* can be NULL */
  513.                                  void *                    iRefCon,
  514.                                  OptionBits             iOptions,
  515.                                  FMFontFamilyIterator *    ioIterator);
  516.  
  517. EXTERN_API_C( OSStatus )
  518. FMGetNextFontFamily                (FMFontFamilyIterator *    ioIterator,
  519.                                  FMFontFamily *            oFontFamily);
  520.  
  521. EXTERN_API_C( OSStatus )
  522. FMCreateFontIterator            (const FMFilter *        iFilter, /* can be NULL */
  523.                                  void *                    iRefCon,
  524.                                  OptionBits             iOptions,
  525.                                  FMFontIterator *        ioIterator);
  526.  
  527. EXTERN_API_C( OSStatus )
  528. FMDisposeFontIterator            (FMFontIterator *        ioIterator);
  529.  
  530. EXTERN_API_C( OSStatus )
  531. FMResetFontIterator                (const FMFilter *        iFilter, /* can be NULL */
  532.                                  void *                    iRefCon,
  533.                                  OptionBits             iOptions,
  534.                                  FMFontIterator *        ioIterator);
  535.  
  536. EXTERN_API_C( OSStatus )
  537. FMGetNextFont                    (FMFontIterator *        ioIterator,
  538.                                  FMFont *                oFont);
  539.  
  540. /* Font families */
  541. EXTERN_API_C( OSStatus )
  542. FMCreateFontFamilyInstanceIterator (FMFontFamily         iFontFamily,
  543.                                  FMFontFamilyInstanceIterator * ioIterator);
  544.  
  545. EXTERN_API_C( OSStatus )
  546. FMDisposeFontFamilyInstanceIterator (FMFontFamilyInstanceIterator * ioIterator);
  547.  
  548. EXTERN_API_C( OSStatus )
  549. FMResetFontFamilyInstanceIterator (FMFontFamily         iFontFamily,
  550.                                  FMFontFamilyInstanceIterator * ioIterator);
  551.  
  552. EXTERN_API_C( OSStatus )
  553. FMGetNextFontFamilyInstance        (FMFontFamilyInstanceIterator * ioIterator,
  554.                                  FMFont *                oFont,
  555.                                  FMFontStyle *            oStyle, /* can be NULL */
  556.                                  FMFontSize *            oSize) /* can be NULL */;
  557.  
  558. EXTERN_API_C( FMFontFamily )
  559. FMGetFontFamilyFromName            (ConstStr255Param         iName);
  560.  
  561. EXTERN_API_C( OSStatus )
  562. FMGetFontFamilyName                (FMFontFamily             iFontFamily,
  563.                                  Str255                 oName);
  564.  
  565. EXTERN_API_C( OSStatus )
  566. FMGetFontFamilyTextEncoding        (FMFontFamily             iFontFamily,
  567.                                  TextEncoding *            oTextEncoding);
  568.  
  569. EXTERN_API_C( OSStatus )
  570. FMGetFontFamilyGeneration        (FMFontFamily             iFontFamily,
  571.                                  FMGeneration *            oGeneration);
  572.  
  573. /* Fonts */
  574. EXTERN_API_C( OSStatus )
  575. FMGetFontFormat                    (FMFont                 iFont,
  576.                                  FourCharCode *            oFormat);
  577.  
  578. EXTERN_API_C( OSStatus )
  579. FMGetFontTableDirectory            (FMFont                 iFont,
  580.                                  ByteCount                 iLength,
  581.                                  void *                    iBuffer,
  582.                                  ByteCount *            oActualLength) /* can be NULL */;
  583.  
  584. EXTERN_API_C( OSStatus )
  585. FMGetFontTable                    (FMFont                 iFont,
  586.                                  FourCharCode             iTag,
  587.                                  ByteOffset             iOffset,
  588.                                  ByteCount                 iLength,
  589.                                  void *                    iBuffer,
  590.                                  ByteCount *            oActualLength) /* can be NULL */;
  591.  
  592. EXTERN_API_C( OSStatus )
  593. FMGetFontGeneration                (FMFont                 iFont,
  594.                                  FMGeneration *            oGeneration);
  595.  
  596. EXTERN_API_C( OSStatus )
  597. FMGetFontContainer                (FMFont                 iFont,
  598.                                  FSSpec *                oFontContainer);
  599.  
  600. /* Conversion */
  601. EXTERN_API_C( OSStatus )
  602. FMGetFontFromFontFamilyInstance    (FMFontFamily             iFontFamily,
  603.                                  FMFontStyle             iStyle,
  604.                                  FMFont *                oFont,
  605.                                  FMFontStyle *            oIntrinsicStyle) /* can be NULL */;
  606.  
  607. EXTERN_API_C( OSStatus )
  608. FMGetFontFamilyInstanceFromFont    (FMFont                 iFont,
  609.                                  FMFontFamily *            oFontFamily,
  610.                                  FMFontStyle *            oStyle);
  611.  
  612. /* Activation */
  613. EXTERN_API_C( OSStatus )
  614. FMActivateFonts                    (const FSSpec *            iFontContainer,
  615.                                  const FMFilter *        iFilter, /* can be NULL */
  616.                                  void *                    iRefCon,
  617.                                  OptionBits             iOptions);
  618.  
  619. EXTERN_API_C( OSStatus )
  620. FMDeactivateFonts                (const FSSpec *            iFontContainer,
  621.                                  const FMFilter *        iFilter, /* can be NULL */
  622.                                  void *                    iRefCon,
  623.                                  OptionBits             iOptions);
  624.  
  625. EXTERN_API_C( FMGeneration )
  626. FMGetGeneration                    (void);
  627.  
  628.  
  629. typedef FMFontFamily                     FontFamilyID;
  630. /*--------------------------------------------------------------------------------------*/
  631. #if OLDROUTINENAMES
  632. enum {
  633.     newYork                        = kFontIDNewYork,
  634.     geneva                        = kFontIDGeneva,
  635.     monaco                        = kFontIDMonaco,
  636.     venice                        = kFontIDVenice,
  637.     london                        = kFontIDLondon,
  638.     athens                        = kFontIDAthens,
  639.     sanFran                        = kFontIDSanFrancisco,
  640.     toronto                        = kFontIDToronto,
  641.     cairo                        = kFontIDCairo,
  642.     losAngeles                    = kFontIDLosAngeles,
  643.     times                        = kFontIDTimes,
  644.     helvetica                    = kFontIDHelvetica,
  645.     courier                        = kFontIDCourier,
  646.     symbol                        = kFontIDSymbol,
  647.     mobile                        = kFontIDMobile
  648. };
  649.  
  650. #endif  /* OLDROUTINENAMES */
  651.  
  652. /*--------------------------------------------------------------------------------------*/
  653.  
  654. #if PRAGMA_STRUCT_ALIGN
  655.     #pragma options align=reset
  656. #elif PRAGMA_STRUCT_PACKPUSH
  657.     #pragma pack(pop)
  658. #elif PRAGMA_STRUCT_PACK
  659.     #pragma pack()
  660. #endif
  661.  
  662. #ifdef PRAGMA_IMPORT_OFF
  663. #pragma import off
  664. #elif PRAGMA_IMPORT
  665. #pragma import reset
  666. #endif
  667.  
  668. #ifdef __cplusplus
  669. }
  670. #endif
  671.  
  672. #endif /* __FONTS__ */
  673.  
  674.